public class Damo {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person1=new Person("张三",20);
        Person person2=(Person) person1.clone();
    }
}

class Person implements Cloneable{
    String name;
    int age;
    public Person(String name,int age){
        this.name=name;
        this.age=age;
    }
    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}